package com.hanoiwiki.manager.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.hanoiwiki.dao.UserStatisticDAO;
import com.hanoiwiki.exception.DataAccessException;
import com.hanoiwiki.manager.UserStatisticManager;
import com.hanoiwiki.model.UserStatistic;

@Component
@Transactional
public class UserStatisticManagerImpl extends BaseManagerImpl implements UserStatisticManager{
	
	@Autowired
	private UserStatisticDAO userStatisticDAO;

	@Override
	public void save(UserStatistic userStatistic) {
		try {
			userStatisticDAO.save(userStatistic);
		} catch (DataAccessException e) {
			log.error("", e);
		}
	}

	@Override
	public void update(UserStatistic userStatistic) {
		try {
			userStatisticDAO.update(userStatistic);
		} catch (DataAccessException e) {
			log.error("", e);
		}
	}

	@Override
	public UserStatistic get(Integer id) {
		try {
			return userStatisticDAO.get(id);
		} catch (DataAccessException e) {
			log.error("", e);
		}
		return null;
	}

	@Override
	public List<UserStatistic> getList() {
		try {
			return userStatisticDAO.getList();
		} catch (DataAccessException e) {
			log.error("", e);
		}
		return null;
	}

	@Override
	public void remove(Integer id) {
		try {
			userStatisticDAO.remove(id);
		} catch (DataAccessException e) {
			log.error("", e);
		}
	}
}
